package com.netas.kekmanager.dao;
import com.netas.kekmanager.dao.model.User;
import com.netas.kekmanager.dao.model.UserPk;
import com.netas.kekmanager.dao.exceptions.UserDaoException;
import java.util.List;

public interface UserDao
{
	/**
	 * Method 'insert'
	 * 
	 * @param dto
	 * @return UserPk
	 */
	public UserPk insert(User dto);

	/** 
	 * Updates a single row in the user table.
	 */
	public void update(UserPk pk, User dto) throws UserDaoException;

	/** 
	 * Deletes a single row in the user table.
	 */
	public void delete(UserPk pk) throws UserDaoException;

	/** 
	 * Returns all rows from the user table that match the criteria 'id = :id'.
	 */
	public User findByPrimaryKey(int id) throws UserDaoException;

	/** 
	 * Returns all rows from the user table that match the criteria ''.
	 */
	public List<User> findAll() throws UserDaoException;

	/** 
	 * Returns all rows from the user table that match the criteria 'user_type_id = :userTypeId'.
	 */
	public List<User> findByUserType(int userTypeId) throws UserDaoException;

	/** 
	 * Returns all rows from the user table that match the criteria 'id = :id'.
	 */
	public List<User> findWhereIdEquals(int id) throws UserDaoException;

	/** 
	 * Returns all rows from the user table that match the criteria 'username = :username'.
	 */
	public List<User> findWhereUsernameEquals(String username) throws UserDaoException;

	/** 
	 * Returns all rows from the user table that match the criteria 'name = :name'.
	 */
	public List<User> findWhereNameEquals(String name) throws UserDaoException;

	/** 
	 * Returns all rows from the user table that match the criteria 'email = :email'.
	 */
	public List<User> findWhereEmailEquals(String email) throws UserDaoException;

	/** 
	 * Returns all rows from the user table that match the criteria 'password = :password'.
	 */
	public List<User> findWherePasswordEquals(String password) throws UserDaoException;

	/** 
	 * Returns all rows from the user table that match the criteria 'user_type_id = :userTypeId'.
	 */
	public List<User> findWhereUserTypeIdEquals(int userTypeId) throws UserDaoException;

	/** 
	 * Returns the rows from the user table that matches the specified primary-key value.
	 */
	public User findByPrimaryKey(UserPk pk) throws UserDaoException;
        
        
        public List<User> findLatest(int limit) throws UserDaoException;

}
